package com.java01.misc.xml;

import net.n3.nanoxml.IXMLElement;
import net.n3.nanoxml.IXMLParser;
import net.n3.nanoxml.StdXMLReader;
import net.n3.nanoxml.XMLParserFactory;
import net.n3.nanoxml.XMLWriter;

public class NanoXMLParser2 {

	public static void main(String[] args) throws Exception{
		IXMLParser parser = XMLParserFactory.createDefaultXMLParser();

		String xmlString = "<XML><NAME>atoo</NAME><WEBSITE>www.java01.com</WEBSITE></XML>";
		parser.setReader(StdXMLReader.stringReader(xmlString));
	
		IXMLElement xml = (IXMLElement) parser.parse(); 
		XMLWriter writer = new XMLWriter(System.out); 
		writer.write(xml);
	}
}
